<script type="text/javascript">
    // 预约处理菜单按钮
    $(document).ready(function () {
        $("#order-menu").click(function () {
            console.log('order');
            $("div.menu-page").css('display','none');
            $("#order-page").css('display','block');
            $.ajax({
                url: '/admin.php/Order/getAllOrder',
                method: 'post',
                dataType: 'json',
                success: function (res) {
                    if (res.code == 200) {
                        $("#order-page").empty();
                        $("#order-page").append(res.data);
                    } else if(res.code == 100) {
                        alert("未搜索到结果，请更改条件重试 !");
                    } else {
                        alert("查询失败，请稍后重试 !");
                    }
                }
            });
        });
    });
    // 套餐管理菜单按钮
    $(document).ready(function () {
        $("#good-menu").click(function () {
            console.log('good');
            $("div.menu-page").css('display','none');
            $("#good-page").css('display','block');
        });
        $.ajax({
            url: 'admin.php/Good/getAllGood',
            dataType:'json',
            method:'get',
            success: function (res) {
                if (res.code == 200) {
                    $("#good_table").empty();
                    $("#good_table").append(res.data);
                }
            }
        });
    });
    // 用户管理菜单按钮
    $(document).ready(function () {
        $("#account-menu").click(function () {
            console.log('account');
            $("div.menu-page").css('display','none');
            $("#account-page").css('display','block');
        });
    });
    // 首页设置菜单按钮
    $(document).ready(function () {
        $("#banner-menu").click(function () {
            console.log('banner');
            $("div.menu-page").css('display','none');
            $("#banner-page").css('display','block');
        });
    });
    //查询预约订单
    $(document).ready(function () {
        $("#order-search").click(function () {
            console.log('search');
            var data = $("#order-form").serialize();
            console.log(typeof data,data);
            $.ajax({
                url: "/admin.php/Order/searchOrder",
                data: data,
                method: 'post',
                dataType: 'json',
                success: function (res) {
                    if (res.code == 200) {
                        $("#order_table").empty();
                        $("#order_table").append(res.data);
                    } else if(res.code == 100) {
                        alert("未搜索到结果，请更改条件重试 !");
                    } else {
                        alert("查询失败，请稍后重试 !");
                    }
                }
            });
        });
    });
</script>
<div class="container">
    <div class="col-md-12">
        <h1><a href="__ACTION__" style="text-decoration: none;color: #0055FF">后台操作界面</a></h1>
    </div>
</div>
<div class="col-md-12 row">
    <div class="col-md-1 text-center">
        <ul class="nav nav-pills nav-stacked">
            <li role="presentation" class="active"><input type="button" name="menu-btn" id="order-menu" class="btn" value="预约处理" style="width: 100%;"></li>
            <li role="presentation" class="active"><input type="button" name="menu-btn" id="good-menu" class="btn" value="套餐管理" style="width: 100%;"></li>
            <li role="presentation" class="active"><input type="button" name="menu-btn" id="account-menu" class="btn" value="用户管理" style="width: 100%;"></li>
            <li role="presentation" class="active"><input type="button" name="menu-btn" id="banner-menu" class="btn" value="首页设置" style="width: 100%;"></li>
        </ul>
    </div>
</div>